﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartSharp
{
    public enum AxisTypes
    {
        x = 0,
        t,
        y,
        r,
    }

    public class AxisType : ChartParam
    {
        protected IEnumerable<AxisTypes> _types;

        public override string Name
        {
            get { return "chxt"; }
        }

        public override string Data
        {
            get
            {
                StringBuilder builder = new StringBuilder();

                if (_types != null)
                {
                    _types.ToList().ForEach((type) =>
                    {
                        builder.Append(type.ToString("g"));
                        builder.Append(",");
                    });

                    if (builder.Length > 0)
                    {
                        builder.Length--;
                    }
                }

                return builder.ToString();
            }
        }

        public AxisType(IEnumerable<AxisTypes> types)
        {
            _types = types;
        }
    }
}
